package vip.xiaonuo.core.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * ClassName: ISLOGINENUM
 *
 * @Description: 是否有权限登录
 **/
public enum ISLOGINENUM {
    //有
    YES("1", "有"),
    //无
    NO("0", "无");

    private String name;
    private String value;

    ISLOGINENUM(String value, String name) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public static List<Map<String, String>> toList() {
        List<Map<String, String>> list = new ArrayList<Map<String, String>>();
        for (ISLOGINENUM item : ISLOGINENUM.values()) {
            Map<String, String> map = new HashMap<String, String>();
            map.put("value", item.getValue());
            map.put("name", item.getName());
            list.add(map);
        }
        return list;
    }

    public static Map<String, String> toMap() {
        Map<String, String> map = new HashMap<String, String>();
        for (ISLOGINENUM item : ISLOGINENUM.values()) {
            map.put(item.getValue(), item.getName());
        }
        return map;
    }

    public static List<String> toStringList() {
        List<String> list = new ArrayList<String>();
        for (ISLOGINENUM item : ISLOGINENUM.values()) {
            list.add(item.getValue());
        }
        return list;
    }
}
